package com.itcrx.algorithm.recursion;

/**
 * @author NoobMaster69  * @date 2024/6/16 0016 星期日 16:55
 */

/**
 * 递归
 */
public class Factorial {
    public static int f(int n) {
        if(n == 1){
            return 1;
        }
        return n * f(n - 1);
    }

    public static void main(String[] args) {
        int f = f(5);
        System.out.println(f);
    }


}
